import pytest,requests
import allure
import uuid
uuid1 = str(uuid.uuid4()).split('-')[0]
project_url = "http://47.113.145.193:8899"
@allure.feature("CRMEB")
class TestCrmeb:
    @pytest.fixture(scope='function',autouse=True)
    def login(self):
        response = requests.post(url=project_url + "/adminapi/login",
                      json={"account": "admin", "pwd": "123456", "imgcode": "11"})
        assert response.status_code == 200
        assert response.json()['msg'] == 'ok'
        self.token = response.json()['data']['token']
    @allure.story("添加用户分组")
    def test_add_user_group(self):
        response = requests.post(url=project_url + "/adminapi/user/user_group/save.html",
                      json={"group_name": "赵政权" + uuid1}, headers={"Authori-zation": f"Bearer {str(self.token)}"})
        assert response.status_code == 200
        assert response.json()['msg'] == "提交成功！"




